<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>javascript json方式的面向对象</title>
<link rel="stylesheet" href="css/base.css" />
<script type="text/javascript" src="js/common.js" ></script>
<style>
	.demo1{width: 400px; height: 300px; background: green; float: right;}
</style>
</head>
<body>
<div class="wrap">
	<h2 class="wrap-h2">javascript json方式的面向对象！</h2>
	<div class="wrap-main wrap-index">
		<!--内容写这里-->
		<div class="div1"></div>
	</div>
</div>
<script>
window.onload = function ()
{
	var a = ['1','2','3'];
	
	//a.splice(2,a.length);			//删除第几个
	//a.splice(2,a.length,'aa');	//在2的索引上替换为aa
	//a.splice(2,1,"aa","bb","sa","qq");				//
	console.log(a)

	var num= '666';
	alert(`${num}`);
	
	/*var str = "12.88";
	
	alert(Math.ceil(str))  	//向上取整，进一位
	alert(Math.floor(str))	//向下取整，退一位
	alert(Math.round(str))  //四舍五入
	*/
	
	//fn(300);
	//fn("abcde");
	//fn(function(){alert("123");});
}


function fn1(){
    return function(){
        alert(1);
    }
}

function fn(a)
{
	if( typeof a === 'number' )
	{
		alert(a+20);
	}
	else if( typeof a === "string" )
	{
		alert(a.charAt(2));
	}
	else if( typeof a === "function" )
	{
		a();
	}
}
</script>
</body>
</html>
